package com.yanfei.zero.domain.user.model.es;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "user1",createIndex = true)
public class EsUser1 implements Serializable {
    @Id
    @Field(type = FieldType.Auto)
    private Long id;
    @Field(type = FieldType.Text,index = true)
    private String name;
    @Field(type = FieldType.Double,index = true)
    private BigDecimal money;
    @Field(type = FieldType.Keyword,index = true)
    private String password;
    @Field(type = FieldType.Keyword,index = true)
    private String email;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Field(type = FieldType.Date, format = DateFormat.date_time, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @Field(type = FieldType.Keyword)
    private String role;
}
